<template>
    <a-card :bordered="false" :bodyStyle="{ padding: 0 }">
        <a-divider style="font-weight: bold;">入住人员登记</a-divider>
        <a-row :gutter="5">
            <FenPeiRoomList :dingdan="dingdan" @selectRoom="handleSelectRoom" @roomList="getRoomList" />
        </a-row>
        <a-divider />
        <a-row :gutter="5">
            <AddRenYuanList :dingdan="dingdan" :selectedRoom="selectedRoom" :selectRoomList="selectRoomList" />
        </a-row>
    </a-card>
</template>

<script>
import FenPeiRoomList from './FenPeiRoomList'
import AddRenYuanList from './AddRenYuanList'

export default {
    name: 'CheckInRenYuanList',
    components: {
        FenPeiRoomList,
        AddRenYuanList
    },
    props: {
        dingdan: {
            type: Object,
            required: true,
        },
        disabled: {
            type: Boolean,
            default: false,
            required: false
        }
    },
    data() {
        return {
            url: {
                getWaitingRooms: '/room/roomInfo/queryUsableRoomList'
            },
            selectedRoom: null,
            selectRoomList: null
        }
    },
    methods: {
        handleSelectRoom(room) {
            this.selectedRoom = room[0]
        },
        getRoomList(value) {
            this.selectRoomList = value
        }
    }
}
</script>